- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 116
 
Add setting for accepting longer user silences #304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Rather than always giving up as soon as Vosk indicates a single period of silence, allow the user to configure Dicio to accept up to seven consecutive periods of silence before it gives up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very useful addition, thank you! I made some comments but I like the overall structure
| @Composable | ||
| fun sttSilenceDuration() = IntSetting( | ||
| title = stringResource(R.string.pref_stt_silence_duration_title), | ||
| icon = Icons.AutoMirrored.Filled.Send, | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use a different icon here, like hourglass_empty
| UNRECOGNIZED, | ||
| INPUT_DEVICE_UNSET, | ||
| INPUT_DEVICE_VOSK -> VoskInputDevice(appContext, okHttpClient, localeManager) | ||
| INPUT_DEVICE_VOSK -> VoskInputDevice(appContext, okHttpClient, localeManager, settings) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user changes the settings after this has been built, the old settings instance will remain. It's probably better to maintain the previous code for the rest of the class and instead pass dataStore here.
| ) { | ||
| _state.value = Listening(speechService, eventListener) | ||
| speechService.startListening(VoskListener(this, eventListener, speechService)) | ||
| speechService.startListening(VoskListener(this, eventListener, settings.sttSilenceDuration, speechService)) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to set settings.sttSilenceDuration to something like 2 by default (i.e. when the setting has never been changed by the user yet)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops I should have pressed "Request changes"
| 
           @celskeggs sorry for the ping, have you had time to look into my review? No worries if you don't have time, just let me know :-)  | 
    
| 
           @Stypox Thanks for your patience! I forgot I had this pull request outstanding, though I haven't really had time to look at this regardless. If you or someone else wants to take over this PR, please feel free, and otherwise I will come back to this when life allows.  | 
    
Rather than always giving up as soon as Vosk indicates a single period of silence, allow the user to configure Dicio to accept up to seven consecutive periods of silence before it gives up.
I've been test driving a checklist skill that reads a list of steps and waits for me to confirm each one, and sometimes I'm not ready to respond immediately to Dicio. By extending the length of time that Vosk listens for speech, I'm able to make this skill more useful. The same option may be useful for other more "interactive" skills, so I'm contributing it as a separate PR before I'm ready to contribute back the checklist skill itself.